const api = require('./api.js');

//微信登录
export const setLogin = (params) => api.posts('member.api.login.applet_login', params);

//获取背景和文字
export const getConfig = (params) => api.get('member.api.login.applet_page_config', params);

//获取小程序码
export const getCodeIndex = (params) => api.post('qrcode.api.index.code', params);


//首页接口
export const getIndexShow = (params) => api.get('index.index', params);
export const getstOrder = (params) => api.get('index.getNearestOrder', params);
//首页获取店铺id
export const storeId = (params) => api.post('index.getNearestStoreId', params);
//超市公告列表
export const getShopcar = (params) => api.get('shop.notice.index', params); 
export const getShopcarto = (params) => api.get('shop.notice.show', params);
//首页=>搜索页面
export const getSosoList = (params) => api.get('goods.search.search&debug=1', params);
//首页=>搜索列表
export const setCaregoryList = (params) => api.post('goods.category_goods', params);
//首页=>删除搜索记录 
export const setSearchDestroy = (params) => api.get('goods.search.destroy', params);

//超级会员=>文字说明
export const getSuperList = (params) => api.get('spree.api.index.pageData', params);
//超级会员=>列表
export const getSuperData = (params) => api.get('spree.api.index.get_list', params);

//首页=>购物车列表
export const getCartList = (params) => api.get('member.api.cart.index', params);
//购物车=>加入购物车
export const setAddCart = (params) => api.post('member.api.cart.add', params);
//购物车=>获取购物车的总数
export const getCartNum = (params) => api.get('member.api.cart.cartCount', params);
//购物车=>删除购物车
export const setCartRemove = (params) => api.posts('member.api.cart.remove', params);
//购物车=>修改购物车数量
export const setUpNum = (params) => api.post('member.api.cart.update', params);
//购物车=>购物车结算前验证
export const setCarSubmit = (params) => api.posts('member.api.cart.submit', params);

//商品=>详情
export const getShopDetail = (params) => api.get('goods.show', params);
//商品=>收藏
export const setFacoriteOr = (params) => api.post('member.favorite.toggle', params)
//商品=>获取下单页数据
export const getCreate = (params) => api.posts('order.api.create.create', params);
//商品=>下单=>获取可以使用的优惠券
export const getCreateList = (params) => api.posts('coupon.api.util.query', params);
//商品=>下单=>提交订单
export const setUpSubmit = (params) => api.posts('order.api.create.submit', params);
//商品=>下单=>订单支付
export const setPlayComPlet= (params) => api.post('order.api.pay.complete', params);
//商品=>下单=>余额订单支付
export const getMember = (params) => api.post('order.api.pay.getMemberCardBalance', params);
//商品=>下单=>获取微信签名
export const getPayShow = (params) => api.get('order.api.pay.show', params);
// 获取手机号
export const getPhone = (params) => api.get('member.api.index.getMobile', params);


// 团购=>团购列表
export const getCatGoryList = (params) => api.get('groups.api.category.get_list', params);
// 团购=>商品详情
export const getDisteData = (params) => api.get('groups.api.goods.main', params);
// 团购=>订单页数据
export const getOrderConfirm = (params) => api.get('groups.api.orders.confirm', params);
// 团购=>读取分类和背景
export const getPageInfo = (params) => api.get('groups.api.index.pageInfo', params);
// 团购=>提交订单
export const setOrderUp = (params) => api.post('groups.api.orders.confirm', params);
// 团购=>获取签名
export const setPlayOride = (params) => api.post('groups.api.pay.main', params);
// 团购=>获取签名
export const setDetailPlayOut = (params) => api.post('groups.api.team.detail', params);


//地址=>地址列表
export const getAddList = (params) => api.get('member.api.address.index', params);
//地址=>设置默认地址
export const setDefayulf = (params) => api.post('member.api.address.setdefault', params);
//地址=>刪除地址
export const setAddressDel = (params) => api.post('member.api.address.delete', params);
//地址=>获取编辑信息
export const getAddrePost = (params) => api.get('member.api.address.post', params);
//地址=>提交编辑信息
export const setUpAddrssData = (params) => api.post('member.api.address.submit', params);

//优惠券=>背景
export const getTopromote = (params) => api.post('coupon.api.index.pageData', params);
//优惠券=>列表
export const getDiscountList = (params) => api.post('coupon.api.getlist', params);
//优惠券=>领取
export const setDetailAdd = (params) => api.post('coupon.api.detail.pay', params);
//优惠券=>我的列表
export const getMyTopromeList = (params) => api.post('coupon.api.my.getlist', params);

//我的=>收藏列表
export const getFavorList = (params) => api.get('member.api.favorite.get_list', params);
//我的=>收藏=>删除收藏
export const setDeleFavor = (params) => api.posts('member.api.favorite.remove', params);
//我的=>个人信息
export const getMyMine = (params) => api.get('member.api.index.center', params);
//我的=>个人信息修改
export const setUpUser = (params) => api.post('member.api.index.update_info', params);

//拼团订单 
export const groupsGetList = (params) => api.get('groups.api.orders.get_list', params);
//拼团=>取消订单
export const getDeleOreder = (params) => api.get('groups.api.orders.cancel', params);
//拼团=>确定收货
export const getOrderFinis = (params) => api.get('groups.api.orders.finish', params);
//拼团=>订单详情
export const getOrderDetail = (params) => api.get('groups.api.orders.detail', params);
//拼团=>退款页面
export const getRefundMain = (params) => api.get('groups.api.refund.main', params);
//拼团=>提交售后
export const setReundSubmit = (params) => api.posts('groups.api.refund.submit', params);
//拼团=>取消售后
export const setRefundCancel = (params) => api.post('groups.api.refund.cancel', params);

//直销=>背景数据
export const getDirectseBg = (params) => api.get('direct.api.index.pageData', params);
//直销=>背景数据
export const getDirectList = (params) => api.get('direct.api.index.get_list', params);


//分销=>分销中心
export const getCenterData = (params) => api.get('distribution.api.index.center', params);
//分销=>我的团队
export const getTeamList = (params) => api.get('distribution.api.index.team', params);
//分销=>推广、规则
export const getRefundRule = (params) => api.get('distribution.api.index.backgroundAndIntro', params);
//分销=>佣金记录                                              
export const getCommissionList = (params) => api.get('distribution.api.index.credit3_log', params);
//分销=>分销订单
export const getOforderList = (params) => api.get('distribution.api.index.order_list', params);
//分销=>提现页面
export const getWithPage = (params) => api.get('distribution.api.index.withdraw_page', params);
//分销=>佣金申请提现
export const getapply = (params) => api.post('distribution.api.index.apply', params);
//分销=>佣金提现记录
export const withdraw_log= (params) => api.get('distribution.api.index.withdraw_log', params);


//首页=>商品分类
export const category= (params) => api.post('goods.category', params);
export const categorygoods= (params) => api.post('goods.category_goods', params);
//订单列表
export const theOrder = (params) => api.get('order.api.index.get_list', params); 
//取消订单
export const cancel= (params) => api.post('order.api.op.cancel', params); 
//订单详情
export const orderDetails = (params) => api.get('order.api.index.detail', params);
//获取核销码
export const getqrcode = (params) => api.post('verify.index.qrcode', params);
//售后、退款
export const refund = (params) => api.get('order.api.refund', params);
//删除订单 
export const delet= (params) => api.post('order.api.op.delete', params);
//确认收货 
export const fetch= (params) => api.post('order.api.op.fetch', params);
//提交申请售后
export const submit= (params) => api.post('order.api.refund.submit', params);
//图片上传
export const uploader = (params) => api.post('util.uploader', params);



//爆款商品列表
export const hotStyle = (params) => api.get('goods.hot&', params); 
